package com.sanlian.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

public class BaseServlet extends HttpServlet {
	@Override
	protected void service(HttpServletRequest arg0, HttpServletResponse arg1)
			throws ServletException, IOException {
		try{
			super.service(arg0, arg1);
		}catch (Exception e) {
			e.printStackTrace();
			Logger.getLogger(BaseServlet.class).info(e.getMessage());
			StackTraceElement[] stackTraceElementArray = e.getStackTrace();
			for (StackTraceElement stackTraceElement : stackTraceElementArray) {
				Logger.getLogger(BaseServlet.class).info(stackTraceElement);
			}
			
		}
	}
}
